package com.ss.grade1;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;

public class Math001 {
    public static void main(String[] args) {

        boolean kaka = true;
        int i = 1;
        int flag = 0;
        while (kaka) {

            int a = RandomUtil.randomInt(10,90);
            int b = RandomUtil.randomInt(3,a);
//            int c = RandomUtil.randomInt(0,2);
            String[] dd = {"+", "-"};
            String bb = ObjectUtil.toString(b).length() == 2 ? ObjectUtil.toString(b) : " " + b;
            String aa = ObjectUtil.toString(a);
            int a1 = Convert.toInt(aa.substring(1,2));
            int b1;
            if(ObjectUtil.toString(b).length() == 2) {
                b1 = Convert.toInt(bb.substring(1,2));
            } else {
                b1 = b;
            }
            if(a + b > 100) {
                if(a1 < b1) {
                    System.out.print(bb + "+  "  + "=" + a + "   ");
                    i++;
                    flag++;
                } else {
//                    System.out.print(bb + "+  "  + "=" + a + "   ");
                }
            } else {
                if(a1 + b1 > 9) {
                    System.out.print(a + "+" + bb + "=     ");
                    i++;
                    flag++;
                } else if (a1 < b1) {
                    System.out.print(a + "-" + bb + "=     ");
                    i++;
                    flag++;
                } else {

                }
            }
            if(i % 6 == 0) {
                i = 1;
                System.out.println();
            }

            if(flag == 100)
                kaka = false;
        }
    }
}
